package com.IR.user.action;

import java.io.IOException;
import java.io.PrintWriter;
import java.util.List;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import com.IR.shop.po.Users;
import com.IR.user.service.AUsersBiz;

@Controller
public class AUsersAction {
	@Resource
	public AUsersBiz biz;
	private Users users;
	private List<Users> list;
	
	public Users getUsers() {
		return users;
	}
	public void setUsers(Users users) {
		this.users = users;
	}
	public List<Users> getList() {
		return list;
	}
	public void setList(List<Users> list) {
		this.list = list;
	}
	
	@RequestMapping(value="/saveUser.do")
	public void saveUser() {
		biz.saveUser();
	}
	@RequestMapping(value="/updateUser.do")
	public void updateUser(HttpServletRequest request,HttpServletResponse response) throws IOException {
		System.out.println("调用");
		response.setHeader("Access-Control-Allow-Origin", "*");
		response.setCharacterEncoding("utf-8");
		Long userid=new Long(request.getParameter("userid"));
		String username=request.getParameter("username");
		String usersex=request.getParameter("usersex");
		Long userphone=new Long(request.getParameter("userphone"));
		String userremark=request.getParameter("userremark");
		int userage=new Integer(request.getParameter("userage"));
		biz.updateUser(userid,username,usersex,userage,userphone,userremark);
		PrintWriter out = response.getWriter();
		out.println(1);
	}
	@RequestMapping(value="/usermoneyUp.do")
	public void usermoneyUp() {
		biz.usermoneyUp();
	}
	@RequestMapping(value="/usermoneyDown.do")
	public void usermoneyDown() {
		biz.usermoneyDown();
	}
}
